package cn.com.api.mapper.base;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import cn.com.api.entity.ApiT_goods_p;

//DAO
public interface T_goods_pMapperBase {

	// 根据id查看
	@Select("SELECT * FROM t_goods_p  WHERE id = #{id}")
	public ApiT_goods_p findT_goods_pById(Integer id);

	// 查看数据集
	@Select("SELECT * FROM T_goods_p")
	public List<ApiT_goods_p> findT_goods_ps();

	// 添加
	@Insert("INSERT INTO t_goods_p (goodsid, filename, path, note, commit_time, status) VALUES (#{goodsid}, #{filename}, #{path}, #{note}, #{commit_time}, #{status})")
	@Options(useGeneratedKeys = true, keyProperty = "id")
	public int insertT_goods_p(ApiT_goods_p t_goods_p);

	// 修改
	@Update("UPDATE t_goods_p SET goodsid = #{goodsid}, filename = #{filename}, path = #{path}, note = #{note}, commit_time = #{commit_time}, status = #{status} WHERE id = #{id}")
	public int updateT_goods_p(ApiT_goods_p t_goods_p);

	// 删除
	@Delete("DELETE FROM t_goods_p  WHERE id = #{id}")
	public int deleteT_goods_p(Integer id);

	// Foreign keys revelant

	// 删除根据Goodsid
	@Delete("DELETE FROM t_goods_p  WHERE goodsid = #{goodsid}")
	public int T_goods_pDeleteByGoodsid(String goodsid);

	// 获取根据Goodsid
	@Select("SELECT id, goodsid, filename, path, note, commit_time, status FROM t_goods_p  WHERE goodsid = #{goodsid}")
	public List<ApiT_goods_p> findT_goods_psByGoodsid(String goodsid);

	// region Indexs revelant

}
